<extend name="Public:base"/>
<block name="title"> 武汉同兴一站办企业服务有限公司 管理中心 - 添加广告分类 </block>

<block name="header">
    <span class="action-span"><a href="#">商品分类</a></span>
    <span class="action-span1"><a href="#">武汉同兴一站办企业服务有限公司 管理中心</a></span>
 <!--   <span id="search_id" class="action-span1"> - 添加分类 </span>-->
    <div style="clear:both"></div>
</block>
<block name="body">

    <form action="" method="post" name="my_form" id="my_form" enctype="multipart/form-data">
        <table width="100%" id="general-table">
            <tr>
                <td class="label">广告分类名称:</td>
                <td>
                    <input type='text' name='class_name' maxlength="20" value='' size='27' /> <font color="red">*</font>
                </td>
            </tr>

            <tr>
                <td class="label">广告状态:</td>
                <td>
                    <input type="radio" name="state" value="1" checked="checked">启用
                    <input type="radio" name="state" value="0">不启用
                </td>
            </tr>

            <tr>
                <td class="label">描述:</td>
                <td>
                    <textarea name="memo"></textarea>
                </td>
            </tr>

            
        </table>
        <div class="button-div">
            <input type="button" id="submit" value=" 确定 " />
            <input type="reset" value=" 重置 " />
        </div>
    </form>
    <script type="text/javascript" src="/public/Admin/JS/jquery.min.js"></script>
    <script>

        $('#submit').click(function (){
            data = $('#my_form').serialize();

            $.ajax({
                url:"{:U('AdcertisingClass/add')}",
                type:'post',
                data:data,
                success:function(data){
                    $data = JSON.parse(data);
                    console.log($data);

                    if($data.state == 200){
                        alert($data.rel);
                        window.setTimeout("window.location='{:U('AdcertisingClass/index')}'",1000);
                    }

                }
            });
        });

    </script>
</block>

